Image scaling refers to expanding (i.e. upscaling) or reducing (i.e. downscaling) an input image to create an output image. When the output image is to become larger than the input image, pixels are added at certain positions in the two-dimensional array of pixels of the input image to create the resulting output image. Similarly, when the output image is to become smaller than the input image, some pixels are removed from the two-dimensional array of pixels of the input image to create the output image.
Consider, for example, scaling a 4×4 pixel (i.e., 16 total pixels) input image into a 10×10 pixel (i.e., 100 total pixels) output image. Since the size of the output image is not an exact integer multiple (two times, three times, etc.) of the input image size, it is not adequate to simply reuse/copy all of the pixels from the input image to create the output image. Instead, some pixels of the input image may be replicated more times than other pixels of the input image. Choosing which pixels from the input image to replicate (or skip, in the case of downscaling) is the subject of various techniques for scaling images.
Image scaling techniques that produce highly accurate output images generally sample/read pixels from fractional positions in the input image and/or incorporate weighted averages for areas in the input image. Although accurate, such techniques are computation-intensive and thus incur undesirable costs in time and expense for many real-world applications. For instance, in the field of printing where pixel values may be represented by eight bits (i.e., 256 different color values), resizing pixels to highly precise floating-point values may take significant processing resources which is not reflected in the quality of the printed output and delays the overall time to print. On the other hand, more basic techniques for scaling images that are based on linear interpolation (e.g., nearest neighbor scaling or Bresenham scaling) are less computation-expensive, but sometimes produce bands or stripes, referred to as artifacts, in the output image. Thus, current image scaling techniques are often either too computationally expensive or too inaccurate with no middle ground.